<!--
 * @Descripttion: 加载列表状态
 * @version: 
 * @Author:Hui
 * @Date: 2022-12-05 10:17:20
 * @LastEditTime: 2023-11-14 21:27:18
 * @LastEditors: sueRimn
-->

<template>
  <view>
    <view v-if="loading">
      <load-skeleton />
    </view>
    <view v-else-if="list && list.length">
      <slot />
      <uni-load-more iconType="circle" :status="haveMore ? 'loading' : (haveMore ? 'more' : 'noMore')" />
    </view>
    <view v-else>
      <slot name="noDataNode" />
      <no-data v-if="noDataText" :noDataText="noDataText" />
    </view>
  </view>
</template>


<script>
export default {
  props: {
    loading: { type: Boolean, default: true },
    loadMore: { type: Boolean, default: false },
    haveMore: { type: Boolean, default: true },
    list: { type: Array, default: [] },
    noDataText: { type: String | Boolean, default: '暂无数据' }
  }
}
</script>